﻿// MIT License
// 开源地址：https://gitee.com/co1024/AbcMvc
// Copyright (c) 2021-2023 1024
// Abc.Mvc=Furion+EF+SqlSugar+Pear layui admin.

namespace Abc.Core.SeedData;

/// <summary>
///     用户数据种子
/// </summary>
public class SysUserSeedData : IEntitySeedData<SysUser>
{
    public IEnumerable<SysUser> HasData(DbContext dbContext, Type dbContextLocator)
    {
        var devpwd = "dev123456654".ToPBKDF2();
        var pwd = "admin123123".ToPBKDF2();
        var pwd2 = "test123987".ToPBKDF2();
        return new List<SysUser>
        {
            new()
            {
                Id = 1,
                Account = "developer",
                Nick = "超级管理员",
                Pwd = devpwd,
                UserType = UserType.系统维护,
                IsEnable = true,
                CreationTime = DateTimeOffset.Now,
                CreatorUserId = 0,
                CreatorUserName = ""
            },
            new()
            {
                Id = 2,
                Account = "administrator",
                Nick = "超级管理员",
                Pwd = pwd,
                UserType = UserType.超级管理员,
                IsEnable = true,
                CreationTime = DateTimeOffset.Now,
                CreatorUserId = 0,
                CreatorUserName = ""
            },
            new()
            {
                Id = 3,
                Account = "testuser",
                Nick = "测试用户",
                Pwd = pwd2,
                UserType = UserType.普通用户,
                IsEnable = true,
                CreationTime = DateTimeOffset.Now,
                CreatorUserId = 0,
                CreatorUserName = ""
            }
        };
    }
}